﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BatchDesvPad
{
    public partial class viz : Form
    {
        public viz()
        {
            InitializeComponent();
        }

        private void viz_Load(object sender, EventArgs e)
        {
            this.openFileDialog1.ShowDialog();
        }

        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            System.Xml.XmlReader xReader = null;
            try
            {
                xReader = System.Xml.XmlReader.Create(this.openFileDialog1.FileName);
                xReader.ReadStartElement();
                var xR2 = xReader.ReadSubtree();
                xR2.ReadToDescendant("Instancia");
                do
                {
                    var classe = xR2.GetAttribute("Classe");
                    var instanciaId = xR2.GetAttribute("Id");
                    xR2.ReadToDescendant("Path");
                } while (xR2.ReadToNextSibling("Instancia"));
            }
            finally
            {
                if (xReader != null)
                    xReader.Close();
            }
        }
    }
}